package com.r2coding.ent.controller;

import org.springframework.beans.factory.annotation.Autowired;

import com.r2coding.ent.entity.SayEntity;
import com.r2coding.ent.service.SayService;
import com.r2coding.common.util.Result;
import org.springframework.web.bind.annotation.*;

/**
 * 说说
 *
 * @author 98k灬
 * @email hk666zx@163.com
 * @date 2022-06-20 19:59:36
 */
@RestController
@RequestMapping("/say")
public class SayController {
    @Autowired
    private SayService sayService;

    /**
     * 保存
     */
    @PostMapping("/save")
    public Result save(@RequestBody SayEntity say){
		sayService.save(say);
        return Result.ok();
    }

    /**
     * 修改
     */
    @PutMapping("/update")
    public Result update(@RequestBody SayEntity say){
		sayService.updateById(say);
        return Result.ok();
    }

    /**
     * 删除
     */
    @DeleteMapping("/delete/{id}")
    public Result delete(@PathVariable("id") Integer id){
		sayService.removeById(id);
        return Result.ok();
    }
}
